<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>鼎鲜团折扣惠民</title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <link href="css/style.css" rel="stylesheet" type="text/css" />

    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
    </script>
</head>
<body>
<section class="aui-flexView">
    <!-- <header class="aui-navBar aui-navBar-fixed"><a href="javascript:;" class="aui-navBar-item"><i
                class="icon "></i></a>
        <div class="aui-center"><span class="aui-center-title">标题</span></div><a href="javascript:;" class="aui-navBar-item"><i class="icon icon-sys"></i></a>
    </header> -->
    <section class="aui-scrollView">
        <div class="aui-head-box">
            <div class="aui-head-fare"><img src="images/head-bg.jpg" alt=""><!-- <button>鼎鲜团折扣惠民大盘</button> --></div>
            <div class="aui-head-body">
                <div class="aui-palace"><a href="javascript:;" class="aui-palace-grid">
                    <div class="aui-palace-grid-icon"><img src="images/icon-head-001.png" alt=""></div>
                    <div class="aui-palace-grid-text">
                        <h2>高级会员</h2>
                        <h1><span id="vip-count">{$order['vip_count']}</span>人</h1>
                    </div>
                </a><a href="javascript:;" class="aui-palace-grid">
                    <div class="aui-palace-grid-icon"><img src="images/icon-head-002.png" alt=""></div>
                    <div class="aui-palace-grid-text">
                        <h2>互助人员</h2>
                        <h1><span id="reward_count">{$order['reward_count']}</span>人</h1>
                    </div>
                </a><a href="javascript:;" class="aui-palace-grid">
                    <div class="aui-palace-grid-icon"><img src="images/icon-head-003.png" alt=""></div>
                    <div class="aui-palace-grid-text">
                        <h2>互助￥额</h2>
                        <h1>￥<span id="reward_price">{$order['reward_price']}</span></h1>
                    </div>
                </a></div>
            </div>
        </div>
        <div class="aui-flex" style="padding-bottom:0">
            <div class="aui-flex-box">
                <h1>当前互助订单进度</h1>
            </div>
        </div>
        {if $order['reward_order']!=null}
        <div class="aui-fare-list"><a href="javascript:;" class="aui-flex" id="reward_progress_list">
            <div class="aui-logo-tag"><img src="images/icon-fl-001.png" alt=""></div>
            <div class="aui-flex-box">
                <h3>会员号：<span id="reward_progress_vip_number">{$order['reward_order']['customer_number']}</span><em><i class="icon icon-tags"></i>￥<span id="reward_progress_order_price">{$order['reward_order']['price']}</span></em></h3>
                <p>下单时间：<span id="reward_progress_order_time">{$order['reward_order']['time']}</span></p>
            </div>
            <div class="aui-button-go"><button><span id="progress">{$order['progress']}</span></button></div>
        </a></div>
        {/if}
        <div class="aui-flex" style="padding-bottom:0;margin-top: 20px">
            <div class="aui-flex-box">
                <h1>已互助订单</h1>
            </div>
        </div>
        {if $order['reward_count']>0}
        <div class="aui-fare-list">
            {volist name="reward_order_list" id="v"}
            <a href="javascript:;" class="aui-flex">
                <div class="aui-logo-tag"><img src="images/icon-fl-003.png" alt=""></div>
                <div class="aui-flex-box">
                    <h3>会员号：<span class="customer_number">{$v.customer_number}</span><em><i class="icon icon-tags"></i>￥<span class="vip_price">{$v.price}</span> </em></h3>
                    <p>全返时间: <span class="reward_time">{$v.time}</span></p>
                </div>
                <!-- <div class="aui-button-go"><i class="icon icon-dow"></i></div> -->
                <div class="aui-button-go"><button>已全返</button></div>
            </a>
            {/volist}
            {$reward_order_list|raw}
        </div>
        {/if}
        <div style="height:60px;"></div>
    </section>
</section>
</body>
</html>

<script>
    // $.ajax({
    //     url: 'https://dxtg.order.ydk1.cn/index/vipOrder',
    //     type: 'GET',
    //     dataType: 'json', // 根据实际情况调整数据类型，例如 'json', 'html', 'xml'
    //     success: function(response) {
    //         // 请求成功后的处理逻辑
    //         console.log('请求成功:', response);
    //         $('#vip-count').text(response.data.vip_count);
    //         $('#reward_count').text(response.data.reward_count)
    //         $('#reward_price').text(response.data.reward_price)
    //         if ( response.data.reward_order!=null){
    //             let reward_order = response.data.reward_order;
    //             $('#progress').text(response.data.progress)
    //             $('#reward_progress_vip_number').text(reward_order.customer_number)
    //             $('#reward_progress_order_time').text(reward_order.time)
    //             $('#reward_progress_order_price').text(reward_order.price)
    //         }else{
    //             $('#reward_progress_list').hide()
    //         }
    //
    //     },
    //     error: function(xhr, status, error) {
    //         // 请求失败后的处理逻辑
    //         console.error('请求失败:', status, error);
    //     }
    // });
    $(document).ready(function() {
        $('.vip_price').each(function() {
            var text = $(this).text();
            if (text.endsWith('.00')) {
                $(this).text(text.slice(0, -3));
            }
        });
    });

    $(document).ready(function() {
        $('.customer_number').each(function() {
            var text = $(this).text();
            if (text.length > 6) {
                var maskedText = text.substring(0, 3) + '***' + text.substring(text.length - 4);
                $(this).text(maskedText);
            } else {
                // 如果字符串长度小于等于6，可以选择保留原样或进行其他处理
                // 这里选择保留原样
                $(this).text(text);
            }
        });
    });


</script>


<style>
    .pagination {
        display: inline-block;
        padding-left: 0;
        margin: 20px 0;
        border-radius: 4px;
    }

    .pagination > li {
        display: inline;
    }

    .pagination > li:first-child > span {
        margin-left: 0;
        border-top-left-radius: 4px;
        border-bottom-left-radius: 4px;
    }

    .pagination > li > a, .pagination > li > span {
        background-color: #FFF;
        border: 1px solid #DDD;
        float: left;
        line-height: 1.42857;
        margin-left: -1px;
        padding: 6px 18px;
        position: relative;
        text-decoration: none;
        color:black;
    }

    .pagination > li.active span {
        background-color: #f6ad55 !important;
        border-color: #DDD;
        cursor: default;
        z-index: 2;
    }

    .pagination > li > a:hover {
        background-color: #eee;
    }

    .pagination > .disabled > span, .pagination > .disabled > span:focus, .pagination > .disabled > span:hover {
        cursor: not-allowed;
        background-color: #fff;
        border-color: #ddd;
    }
</style>